package com.chujian.wx.entity;

import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.chujian.framework.core.IId;
import com.chujian.framework.core.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * @author yj
 * @since 2021-10-14
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@TableName("wx_minip_user")
@KeySequence("wx_minip_user_seq")
@ApiModel(value = "实体", description = "")
public class WxMinipUser extends BaseEntity implements IId, Serializable {

    private static final long serialVersionUID = 1L;

    @TableId("wx_minp_user_id")
    private Long wxMinpUserId;

    @ApiModelProperty(value = "APPID")
    @TableField("app_id")
    private String appId;

    @ApiModelProperty(value = "应用名称")
    @TableField("app_name")
    private String appName;

    @ApiModelProperty(value = "来源产品ID")
    @TableField("from_prod_id")
    private Long fromProdId;

    @ApiModelProperty(value = "OPENIO")
    @TableField("open_id")
    private String openId;

    @ApiModelProperty(value = "性别")
    @TableField("gender")
    private String gender;

    @ApiModelProperty(value = "语音")
    @TableField("language")
    private String language;

    @ApiModelProperty(value = "昵称")
    @TableField("nickname")
    private String nickname;

    @ApiModelProperty(value = "城市")
    @TableField("city")
    private String city;

    @ApiModelProperty(value = "省份")
    @TableField("province")
    private String province;

    @ApiModelProperty(value = "国家")
    @TableField("country")
    private String country;

    @ApiModelProperty(value = "头像")
    @TableField("head_img_url")
    private String headImgUrl;

    @ApiModelProperty(value = "UNIONID")
    @TableField("union_id")
    private String unionId;

    @TableField("watermark_timestamp")
    private String watermarkTimestamp;

    @TableField("watermark_app_id")
    private String watermarkAppId;

    @TableField("session_key")
    private String sessionKey;

    // ++++++ 系统拓展 +++++++
    @TableField(exist = false)
    private Map<String, String> query = new HashMap<>();

    @Override
    public Long getId() {
        return this.wxMinpUserId;
    }

    @Override
    public void setId(Serializable id) {
        if (null != id) {
            this.wxMinpUserId = Long.parseLong("" + id);
        }
    }

    // ++++++ 业务拓展 +++++++
}
